Unify battery and Mac mini stats dashboards - #21
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
There was a problem hiding this comment.
Pull request overview
This PR refactors the Stats UI so both battery Macs and Mac minis render through a single StatsView root while keeping their mode-specific data loading separate. It centralizes the shared window layout and app-table components to prevent future UI drift between device modes, and adds a dev-only --show-stats launch path for deterministic visual checks.
Changes:
- Introduces shared Stats dashboard building blocks (layout, header anatomy, table header, and reusable app row).
- Re-routes battery Stats and Mac mini Stats through a unified
StatsView, while preserving separate data lifecycles (BatteryStatsDashboardvsMacMiniStatsDashboard). - Adds dev-only
--show-statslaunch behavior to open the appropriate Stats window for the current device mode.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Tests/JuiceTests/StatsDashboardComponentsTests.swift | Adds coverage for shared column configuration, minimum sizes, and a basic render/bitmap sanity check for shared table components. |
| Tests/JuiceTests/MacMiniPowerRangeTests.swift | Updates minimum-size assertion to reference the unified StatsView server minimum height. |
| Sources/Juice/Stats/StatsWindow.swift | Updates window presenters to use the unified StatsView entry points and the new mode-specific minimum sizes. |
| Sources/Juice/Stats/StatsView.swift | Implements the unified StatsView root and refactors battery Stats to use shared dashboard components and a reusable app row. |
| Sources/Juice/Stats/StatsDashboardComponents.swift | Adds shared reusable dashboard layout/header/table components and a unified app row implementation. |
| Sources/Juice/Stats/MacMiniStatsView.swift | Renames/refactors Mac mini Stats content to MacMiniStatsDashboard and adopts shared dashboard/table components. |
| Sources/Juice/JuiceApp.swift | Adds --show-stats dev-only launch path and refactors model initialization to reuse the initial model instance when opening battery Stats. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
EClinick
force-pushed
the
task/ec/unify-stats-dashboard
branch
from
August 9, 2026 08:08
c771813 to
11ffbeb
Compare
EClinick
force-pushed
the
task/ec/unify-stats-dashboard
branch
from
August 9, 2026 08:15
11ffbeb to
db77809
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
StatsViewroot while preserving their mode-specific state and data loading.LIVE W,ENERGY / COST, andCPU TIME.masterfrom Customize stats tabs and improve popover scrolling #22 by composing its shared controls inside the unified dashboard headers.--show-statslaunch path for deterministic visual verification.Why
Battery and Mac mini Stats had evolved into separate page implementations. Sharing the structural components keeps their UI consistent without conflating their different data lifecycles: battery ranges retain battery-session and historical-energy coordination, while Mac mini retains server-power history and live-watts loading.
Integration with #22
PR #22 merged before this PR. This branch is now rebased directly onto that merge and retains its persistent tab customization and popover scrolling behavior. The only overlaps were the battery and Mac mini Stats headers; they now use this PR's shared dashboard structure with #22's shared range controls.
Verification
make test— 317 tests passed across 42 suites on the combined resultgit diff --check